package org.gd.hellojson.jackson.wrapper;

import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.ObjectWriter;

import java.io.IOException;
import java.util.Locale;

/**
 * @author Gorhover
 * @version 1.0-SNAPSHOT
 * @since 2013-09-18 09:14
 */
class App {

    public static void main(String[] args) throws IOException {
        Address address = new Address();
        address.setCity("Dnepropetrovsk");
        address.setCountry("Ukraine");
        address.setLocale(new Locale("uk", "UA"));
        User user = new User();
        user.setId(10);
        user.setName("User Name");
        user.setAddress(address);
        WrapperFW<User> controller = new WrapperFW<>();
        Object request = controller.wrap(user);
        ObjectWriter writer = new ObjectMapper().writerWithDefaultPrettyPrinter();
        System.out.println(writer.writeValueAsString(request));
    }
}
